﻿using BepInEx;
using System;
using UnityEngine;
using HarmonyLib;
using UnityEngine.UI;
using System.Collections.Generic;

namespace tiandiguixu.foring
{
    /// <summary>
    /// 百草园自动种植收割
    /// </summary>
    public partial class ForingMod
    {
        //[HarmonyPrefix, HarmonyPatch(typeof(GlobalController), "NextTurnButtonClick")]
        //public static void GlobalController_NextTurnButtonClick_Prefix(GlobalController __instance)
        //{
        //    RefreshSacrifice(__instance); 
        //}

        //[HarmonyPostfix, HarmonyPatch(typeof(GlobalController), "NextTurnButtonClick")]
        //public static void GlobalController_NextTurnButtonClick_Postfix()
        //{ 
        //    instance.Logger.LogInfo("回合结束 自动收割");
        //    //如果成熟了，就收割，顺便再种
        //    foreach (var item in FarmArea.instance.Farms)
        //    {
        //        if (item.plantGrowFunction.PlantName != "" && item.plantGrowFunction.isRipe)
        //        {
        //            var plantName = item.plantGrowFunction.PlantName;
        //            instance.Logger.LogInfo("自动收割" + plantName);
        //            EventManager.Instance.eventRecordPanel.AddRecord("自动收割" + plantName, RecordChannel.门派);
        //            item.plantGrowFunction.GetOutPut();
        //            //FarmArea.instance.ListSeedList();


        //            //种下原来的种子
        //            instance.Logger.LogInfo(FarmArea.instance.SeedList.gameObject.activeSelf);
        //            FarmArea.instance.FreshSeed(plantName);
        //            item.PlantIt(plantName);
        //            item.FreshSelf();
        //            instance.Logger.LogInfo("自动种下" + plantName);
        //            EventManager.Instance.eventRecordPanel.AddRecord("自动种下" + plantName, RecordChannel.人物);
        //        }
        //    }
        //} 
    }
}
